﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;

namespace WPFSchematics.Definition.Entities
{
    /// <summary>
    /// 标识类。此类型用于标识实体类型及其实例。
    /// </summary>
    public class Naming : DependencyObject,ICloneable
    {
        /// <summary>
        /// 类型ID。
        /// </summary>
        public static readonly DependencyProperty IDProperty = DependencyProperty.Register(
        "ID",
        typeof(int),
        typeof(Naming)
        );

        /// <summary>
        /// 类型ID。
        /// </summary>
        public int ID
        {
            set { SetValue(IDProperty, value); }
            get { return (int)GetValue(IDProperty); }
        }

        /// <summary>
        /// 类型名称。
        /// </summary>
        public static readonly DependencyProperty NameProperty = DependencyProperty.Register(
        "Name",
        typeof(string),
        typeof(Naming)
        );

        /// <summary>
        /// 类型名称。
        /// </summary>
        public string Name
        {
            set
            {
                SetValue(NameProperty, value);
            }
            get
            {
                return (string)GetValue(NameProperty);
            }
        }

        /// <summary>
        /// 类型ID。
        /// </summary>
        public static readonly DependencyProperty TGUIDProperty = DependencyProperty.Register(
        "TGUID",
        typeof(Guid),
        typeof(Naming)
        );

        /// <summary>
        /// 类型ID。
        /// </summary>
        public Guid TGUID
        {
            set { SetValue(TGUIDProperty, value); }
            get { return (Guid)GetValue(TGUIDProperty); }
        }

        /// <summary>
        /// 标签。
        /// </summary>
        public static readonly DependencyProperty DescriptionProperty = DependencyProperty.Register(
        "Description",
        typeof(string),
        typeof(Naming)
        );

        /// <summary>
        /// 标签。
        /// </summary>
        public string Description
        {
            set 
            {
                SetValue(DescriptionProperty, value);
            }
            get 
            {
                return (string)GetValue(DescriptionProperty);
            }
        }
        
        #region ICloneable 成员

        public object Clone()
        {
            Naming naming = new Naming();
            naming.ID = this.ID;
            naming.Name = this.Name;
            naming.Description = "";
            return naming;
        }

        #endregion
    }
}
